<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>新建消费审核规则</title>
<%@include file="../collect/meta.jsp"%>
<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
<link rel="stylesheet" href="css/Inputstyle.css" type="text/css"></link>
<link rel="stylesheet" href="css/mshop.css" type="text/css"></link>
<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx }/calender/WdatePicker.js"></script>
</head>
<body lang="zh-cn">
	<div class="wrapper">
		<c:import url="/collect/top.jsp"></c:import>
		<div class="main-container" id="main-container">
			<div class="main-container-inner">
				<c:import url="/collect/left.jsp"></c:import>
				<div class="main-content">
					<div class="breadcrumbs" id="breadcrumbs">
						<ul class="breadcrumb">
							<li><i class="icon-home home-icon"></i><a href="functionaction!watchAllFunction">消费审核</a></li>
							<li>新建消费审核规则</li>
						</ul>
						<!-- .breadcrumb -->
					</div>
					<div class="page-content">
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<form action="logconsumeexamineaction!addExamineSetting" name="addSetting" method="post">
									<div align="center">
										<div class="common">
											<label for="one">每日自动审核金额上限:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
											<input type="text" class="input" id="one" name="examineSetting.dailyMoneyLimit" />
											<div id="content" class="cont"></div>
										</div>
										<div class="common">
											<label for="two">审核启动时间:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
											<input type="text" class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
												style="width:180px;height:30px;" placeholder="审核启动时间"
												id="two" name="examineSetting.examineBegintime">
										</div>
										<div class="common">
											<label for="three">自动审核间隔时长（小时）:&nbsp;</label>
											<input type="text" class="input" id="three" name="examineSetting.examineInterval" />
										</div>
										<div id="btn-team">
											<input type="button" class="btn btn-primary radius" id="but" value="添加" />
										</div>
									</div>
								</form>
								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
				<!-- /.main-content -->
			</div>
			<!-- /.main-container-inner -->
			<a href="#" id="btn-scroll-up"
				class="btn-scroll-up btn btn-sm btn-inverse"
				style="position:fixed;bottom:0;"> <i
				class="icon-double-angle-up icon-only bigger-110"></i> </a>
		</div>
		<!-- /.main-container -->
		<div class="push"></div>
	</div>
	<c:import url="/collect/down.jsp"></c:import>

	<script type="text/javascript">
		$(document).ready(function() {
			$("#but").click(function() {
				var one = $("#one").val();
				if (one.length == 0) {
					alert("请填写每日自动审核金额上限!");
					return false;
				}
				
				if (isNaN(one)) {
					alert("每日自动审核金额上限不是数字!");
					return false;
				}
										
				var two = $("#two").val();
				if (two.length == 0 || two == "审核启动时间") {
					alert("请填写审核启动时间!");
					return false;
				}
				var beginTime = new Date(two.replace("-", "/").replace("-", "/"));
				var nowTime = new Date();
				if (beginTime <= nowTime) {
					alert("审核启动时间必须大于当前时间!");
					return false;
				}
									
				var three = $("#three").val();
				if (three.length == 0) {
					alert("请填写审核间隔时长!");
					return false;
				}
				if (!/^\+?[1-9][0-9]*$/.test(three)) {
					alert("审核间隔时长不是非0正整数!");
					return false;
				}
				
				$("form[name='addSetting']").submit();
			});
		});
		
		//防dropmenu刷新收回
		$('.xiaofeishenhe > ul').show();
		$('.xiaofeishenhe > ul > li > a').eq(0).css("color", "red");
	</script>
</body>
</html>